package com.example.springstudy.dao.dto;

import com.example.springstudy.entity.User;
import lombok.Data;

import java.util.List;

@Data
public class UserListDto {
    private Long total;
    private List<User> list;
    private Integer currentPage;
    private Integer totalPage;

    public UserListDto(Long total, List<User> list, int page, int size) {
        this.total = total;
        this.list = list;
        this.currentPage = page;
        this.totalPage = (int) (total/size) + (total % size == 0 ? 0 : 1);
    }
}
